$(document).ready(function () {
    query();
})

/*查询全部课程*/
var query = function () {
    $('#dataTable').dataTable({
        "bDeferRender": true,
        "sAjaxDataProp": "data.courseAcademy",
        "sAjaxSource": "http://localhost:8080/course/queryAllCourse",
        "sPaginationType": "bs_full", //"bs_normal", "bs_two_button", "bs_four_button", "bs_full"
        "fnPreDrawCallback": function (oSettings) {
            $('.dataTables_filter input').addClass('form-control input-large').attr('placeholder', 'Search');
            $('.dataTables_length select').addClass('form-control input-small');
        },
        "oLanguage": {
            "sSearch": "",
            "sLengthMenu": "<span>_MENU_ entries</span>"
        },
        "bJQueryUI": false,
        "bAutoWidth": false,
        "sDom": "<'row'<'col-lg-6 col-md-6 col-sm-12 text-center'l><'col-lg-6 col-md-6 col-sm-12 text-center'f>r>t<'row-'<'col-lg-6 col-md-6 col-sm-12'i><'col-lg-6 col-md-6 col-sm-12'p>>",
        "aoColumns": [
            {"mDataProp": "courseName"},
            {"mDataProp": "courseNum"},
            {"mDataProp": "academyName"},
            {"mDataProp": "courseCredithour"},
            {"mDataProp": "coursePeriod"},
            {"mDataProp": "courseType"},
        ],
    })
};
